package com.swust.exam.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.swust.exam.dao.ExamMapper;
import com.swust.exam.pojo.Exam;

@Service
public class ExamService {
	@Autowired
	private ExamMapper examMapper;
	
	public Exam get(int id){
		return examMapper.selectByPrimaryKey(id);
	} 
	
	public int delete(int id) {
		return examMapper.deleteByPrimaryKey(id);
	}
	
	public int insert(Exam exam) {
		return examMapper.insert(exam);
	}
	
	public int update(Exam exam) {
		return examMapper.updateByPrimaryKey(exam);
	}

}
